package com.shigen.demo.base;

import com.shigen.demo.base.EqualsAndHashCode.User;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.LinkedList;

/**
 * ArrayListAndLinkedList
 *
 * @author shigenfu
 * @date 2022/5/13 11:00 下午
 */
public class ArrayListAndLinkedList {

  public static void main(String[] args) {
    ArrayList<Object> arrayList = new ArrayList<>();
    LinkedList<Object> linkedList = new LinkedList<>();

    linkedList.add("aaa");
    linkedList.add(1234);
    linkedList.add(new User("shigen"));
    linkedList.add(new BigDecimal("10.2789"));

    System.out.println(linkedList.peekFirst());
    System.out.println(linkedList.peekLast());

    System.out.println(linkedList.pollLast());
    System.out.println(linkedList.size());


  }

}
